import React, { Component, createRef } from 'react'

type Props = {
    images: string[];
    height: string;
    width: string;
    active: Function
}

type State = {
    div: React.RefObject<HTMLDivElement>
}

export default class Carimage extends Component<Props, State> {
    constructor(props: Props) {
        super(props)
        const div = createRef<HTMLDivElement>()
        this.state = {
            div
        }
    }

    active() {

    }

    render() {
        const { images, height, width } = this.props
        const { div } = this.state
        return <div ref={div} className="carimage" >
            {
                images.slice(0, 9).map((v, _k) => {
                    <img src={v} width={width} height={height} alt="" />
                })
            }

        </div>
    }
}